package com.knowledgegraph.zhongyao.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.knowledgegraph.zhongyao.mapper.MedicineTypeMapper;
import com.knowledgegraph.zhongyao.domain.MedicineType;
import com.knowledgegraph.zhongyao.service.IMedicineTypeService;

/**
 * 药材类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-25
 */
@Service
public class MedicineTypeServiceImpl implements IMedicineTypeService 
{
    @Autowired
    private MedicineTypeMapper medicineTypeMapper;

    /**
     * 查询药材类型
     * 
     * @param medicineTypeKey 药材类型主键
     * @return 药材类型
     */
    @Override
    public MedicineType selectMedicineTypeByMedicineTypeKey(Long medicineTypeKey)
    {
        return medicineTypeMapper.selectMedicineTypeByMedicineTypeKey(medicineTypeKey);
    }

    /**
     * 查询药材类型列表
     * 
     * @param medicineType 药材类型
     * @return 药材类型
     */
    @Override
    public List<MedicineType> selectMedicineTypeList(MedicineType medicineType)
    {
        return medicineTypeMapper.selectMedicineTypeList(medicineType);
    }

    /**
     * 新增药材类型
     * 
     * @param medicineType 药材类型
     * @return 结果
     */
    @Override
    public int insertMedicineType(MedicineType medicineType)
    {
        return medicineTypeMapper.insertMedicineType(medicineType);
    }

    /**
     * 修改药材类型
     * 
     * @param medicineType 药材类型
     * @return 结果
     */
    @Override
    public int updateMedicineType(MedicineType medicineType)
    {
        return medicineTypeMapper.updateMedicineType(medicineType);
    }

    /**
     * 批量删除药材类型
     * 
     * @param medicineTypeKeys 需要删除的药材类型主键
     * @return 结果
     */
    @Override
    public int deleteMedicineTypeByMedicineTypeKeys(Long[] medicineTypeKeys)
    {
        return medicineTypeMapper.deleteMedicineTypeByMedicineTypeKeys(medicineTypeKeys);
    }

    /**
     * 删除药材类型信息
     * 
     * @param medicineTypeKey 药材类型主键
     * @return 结果
     */
    @Override
    public int deleteMedicineTypeByMedicineTypeKey(Long medicineTypeKey)
    {
        return medicineTypeMapper.deleteMedicineTypeByMedicineTypeKey(medicineTypeKey);
    }
}
